===TRIGGERS===
Triggers execute actions when defined conditions are met. It is possible to script many kinds of events in your scenarios using triggers (often in conjunction with variables). 

If your scenario will use any triggers you must add a "triggers.txt" file to the scenario folder. In this file you can then define one trigger per line. Each trigger must start with a "~"

After a trigger has been defined in triggers.txt it must set to active somewhere in your game scripts for it to work. The command to do this is: "~trigger.[TriggerName].active" ; you can also deactivate an active trigger with "~trigger.[TriggerName].inactive"

When a trigger is active and subsequently executed by the player it is then automatically set to inactive. You can reuse that trigger, but you must set it to active again. 

Trigger Types:

1. Variable is equal to #
Syntax: ~[TriggerName]~1~[Variable Name]~[Variable Condition Value]~Commands*

2. Variable is less than #
Syntax: ~[TriggerName]~2~[Variable Name]~[Variable Condition Value]~Commands*

3. Variable is less than or equal to #
Syntax: ~[TriggerName]~3~[Variable Name]~[Variable Condition Value]~Commands*

4. Variable is greater than #
Syntax: ~[TriggerName]~4~[Variable Name]~[Variable Condition Value]~Commands*

5. Variable is greater than or equal to #
Syntax: ~[TriggerName]~5~[Variable Name]~[Variable Condition Value]~Commands*

6. [NO LONGER PRESENT]

7. Player is facing a certain direction has walked past an X or Y coordinate on a specific map
Syntax: ~[TriggerName]~7~[Direction]~[Map Number]~[X or Y]~[Coordinate]~Commands*

8. Player has entered a specific map
Syntax: ~[TriggerName]~8~[Map Number]~Commands*

9. Player has left a specific map
Syntax: ~[TriggerName]~9~[Map Number]~Commands*

10. Player has entered CP mode with a specific character
Syntax: ~[TriggerName]~10~[NPC Name]~Commands*

11. Number of individual strokes in CP mode for an NPC character has exceeded a certain number 
Syntax: ~[TriggerName]~11~[NPC Name]~[Maximum Strokes]~Commands*

12. Overall severity of strokes in CP mode for an NPC character has exceeded a certain number (severity of each stroke is equal to one times the strength level) 
Syntax: ~[TriggerName]~12~[NPC Name]~[Maximum Severity]~Commands*

13. Generates a random number between 1 and 512 and assigns it to a variable
Syntax: ~[TriggerName]~13~[To Variable Name]~[Minimum Number]~[Maximum Number]

14. Generates a random number between 1 and 512 and assigns it to a variable; it will never choose the same number twice if the trigger is called multiple times 
Syntax: ~[TriggerName]~14~[To Variable Name]~[Minimum Number]~[Maximum Number]

15. When the swing strength of last stroke in cp mode is equal to or greater then the set value
Syntax: ~[TriggerName]~15~[Swing Strength of Previous Stroke]~Commands*

(Special ote: Upon exiting cp mode all type 15 triggers in the game are automatically set to inactive. Type 15 triggers should only be set to active just prior to entering the cp session they are for.)

16. Variable 1 is equal to Variable 2
Syntax: ~[TriggerName]~16~[Variable 1 Name]~[Variable 2 Name]~Commands*

17. Variable 1 is greater then Variable 2
Syntax: ~[TriggerName]~17~[Variable 1 Name]~[Variable 2 Name]~Commands*

18. Variable 1 is less then Variable 2
Syntax: ~[TriggerName]~18~[Variable 1 Name]~[Variable 2 Name]~Commands*

19. When in cp mode, execute different commands if previous swing strength was low, medium, high or very high
Syntax: ~[TriggerName]~19~[NPC Name]~[Stroke Number]~[Commands If Low Strength]~[Commands If Med Strength]~[Commands If High Strength]~[Commands If Very High Strength]

20. When in cp mode if number of strokes for specific character equals a value:
Syntax: ~[trigger name]~20~[npc name]~[stroke number]~[command(s)]

(Not to be confused with trigger type #11, which is when the strokes have exceeded a value)


===VARIABLES===
A variables holds numerical data that is subject to change. For example in M&P when Liam needs to collect branches to make a birch he needs to visit three locations. A variable holds a number value corresponding to this. When the variable value becomes three it kicks off a trigger for the next part of the storyline. 

If your scenario will use any variables you must add a "variables.txt" file to the scenario folder. In this file you can then define one trigger per line. Each variable must start with a "~"

~[Variable Number]~[Variable Name]~1

Variable number can be any number you choose between 1 and 512. Variable name can be any alpha-numberic name you want. The "1" at the end must always be present; this is NOT the value of the variable; rather it is for compatibility with the old way DMA handled variables ("1" meant numeric while a "2" meant string; string variables are no longer present in the game)

Refer to the script commands file for ways maniupulate variables. 